<?php
/* --------------------------------------------------------------
   gm_gprint_admin_orders.php 2009-11-30 mb
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2009 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/
?><?php 

require_once(DIR_FS_CATALOG . 'gm/modules/gm_gprint_tables.php');
require_once(DIR_FS_CATALOG . 'gm/classes/GMJSON.php');
require_once(DIR_FS_CATALOG . 'gm/classes/GMGPrintConfiguration.php');
require_once(DIR_FS_CATALOG . 'gm/classes/GMGPrintContentManager.php');
require_once(DIR_FS_CATALOG . 'gm/classes/GMGPrintOrderElements.php');
require_once(DIR_FS_CATALOG . 'gm/classes/GMGPrintOrderSurfaces.php');
require_once(DIR_FS_CATALOG . 'gm/classes/GMGPrintOrderSurfacesManager.php');
require_once(DIR_FS_CATALOG . 'gm/classes/GMGPrintOrderManager.php');

$coo_gm_gprint_content_manager = new GMGPrintContentManager();
$coo_gm_gprint_order_data = $coo_gm_gprint_content_manager->get_orders_products_content($order->products[$i]['opid'], true);

for($m = 0; $m < count($coo_gm_gprint_order_data); $m++)
{
	if(empty($coo_gm_gprint_order_data[$m]['DOWNLOAD_KEY']))
	{		
		echo '<br /><nobr><small>&nbsp;<i> - ' . $coo_gm_gprint_order_data[$m]['NAME'] . ': ' . $coo_gm_gprint_order_data[$m]['VALUE'] . '</i></small></nobr>';
	}
	else
	{
		echo '<br /><nobr><small>&nbsp;<i> - ' . $coo_gm_gprint_order_data[$m]['NAME'] . ': <a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'gm_gprint_download.php?key=' . $coo_gm_gprint_order_data[$m]['DOWNLOAD_KEY'] . '"><u>' . $coo_gm_gprint_order_data[$m]['VALUE'] . '</u></a></i></small></nobr>';
	}
}

$coo_grint_order_manager = new GMGPrintOrderManager();
$t_order_surfaces_groups_id = $coo_grint_order_manager->get_order_surfaces_groups_id($order->products[$i]['opid']);

if($t_order_surfaces_groups_id > 0)
{
	echo '<div id="show_order_surfaces_groups_id_' . $t_order_surfaces_groups_id . '"><span style="font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: bold; cursor: pointer"><br />&nbsp;Details<br /></span></div>';
	echo '<div style="overflow: hidden; display: none;" class="gm_gprint_order_set" id="order_surfaces_groups_id_' . $t_order_surfaces_groups_id . '">';
	echo "\n<br />\n";
	echo '<ul id="gm_gprint_tabs_' . $t_order_surfaces_groups_id . '"></ul>';
	echo "\n";
	echo '<div id="gm_gprint_content_' . $t_order_surfaces_groups_id . '" class="gm_gprint_content"></div>';
	echo "\n";
	echo '</div><br style="clear: both;" />';
	echo "\n";
	echo "<script>
			$('#show_order_surfaces_groups_id_" . $t_order_surfaces_groups_id . "').click(function()
			{
				$('#order_surfaces_groups_id_" . $t_order_surfaces_groups_id . "').toggle();
			});
		</script>";
}

?>